import request from "@/utils/request";
// 获取统计数据
export function getStatistics() {
  return request({
    url: "/XcxPageData/statistics",
    method: "get",
  });
}

// 获取数据
export function getBannerList(data) {
  // console.log(data);
  return request({
    url: "/XcxPageData/list",
    method: "get",
    params: data,
  });
}
// 获取单个图片数据
export function getBannerById(data) {
  return request({
    url: "/XcxPageData/ " + data,
    method: "get",
  });
}

// 图片上传
export function uploadImage(data) {
  return request({
    url: "/XcxPageData/upload",
    method: "post",
    headers: {
      "Content-Type": "multipart/form-data;",
    },
    data: data,
    timeout: 100000,
  });
}

// 添加图片数据
export function addBanner(data) {
  return request({
    url: "/XcxPageData",
    method: "post",
    data: data,
  });
}

// 修改图片数据
export function updateBanner(data) {
  return request({
    url: "/XcxPageData/update",
    method: "put",
    data: data,
  });
}

// 删除oss数据
export function deleteOssFile(data) {
  return request({
    url: "/XcxPageData/deleteBucketFile",
    method: "delete",
    data: data,
  });
}

// 删除图片数据
export function deleteData(data) {
  return request({
    url: "/XcxPageData",
    method: "delete",
    data: data,
  });
}
